using System;
using System.Collections.Generic;
using System.Web.Services.Protocols;
using System.Collections;
using System.Xml.Serialization;

namespace PlaySpark.Web.WebServices
{
	[XmlTypeAttribute("MappingNames")]
	public class mappingNames : SoapHeader, IList<string>
	{
		private List<string> items;

		public mappingNames()
		{
			items = new List<string>();
		}

		public mappingNames(IEnumerable<string> collection)
		{
			items = new List<string>(collection);
		}

		public mappingNames(int capacity)
		{
			items = new List<string>(capacity);
		}

		#region IList<string> Members

		public int IndexOf(string item)
		{
			return items.IndexOf(item);
		}

		public void Insert(int index, string item)
		{
			items.Insert(index, item);
		}

		public void RemoveAt(int index)
		{
			items.RemoveAt(index);
		}

		public string this[int index]
		{
			get
			{
				return items[index];
			}
			set
			{
				items[index] = value;
			}
		}

		#endregion

		#region ICollection<string> Members

		public void Add(string item)
		{
			items.Add(item);
		}

		public void Clear()
		{
			items.Clear();
		}

		public bool Contains(string item)
		{
			return Contains(item);
		}

		public void CopyTo(string[] array, int arrayIndex)
		{
			items.CopyTo(array, arrayIndex);
		}

		public int Count
		{
			get { return items.Count; }
		}

		public bool IsReadOnly
		{
			get { return false; }
		}

		public bool Remove(string item)
		{
			return items.Remove(item);
		}

		#endregion

		#region IEnumerable<string> Members

		public IEnumerator<string> GetEnumerator()
		{
			return items.GetEnumerator();
		}

		#endregion

		#region IEnumerable Members

		IEnumerator IEnumerable.GetEnumerator()
		{
			return items.GetEnumerator();
		}

		#endregion
	}
}
